<?php
$di = \Phalcon\Di::getDefault();
$output = array(
    '_id' => 'adminEntityFilterNode',
    '_name' => '过滤',
    '_layout' => 'inline',
    '_form' => array(
        'action' => staticUrl(),
        'method' => 'get',
        'class' => 'form-inline',
        'ajax-submit' => '#main',
        'accept-charset' => 'utf-8',
        'role' => 'form',
        'id' => 'adminEntityFilterNode',
    ),
    'contentModel' => array(
        'label' => '文章类型',
        'error' => '',
        'userOptions' => array(),
        'description' => '',
        'field' => 'string',
        'widget' => 'Select',
        'options' => array(
            'null' => '不限制'
        ),
        'validate' => array(),
        'attributes' => array(
            'class' => 'form-control',
        ),
        'required' => false,
    ),
    'state' => array(
        'label' => '状态',
        'error' => '',
        'userOptions' => array(),
        'description' => '',
        'field' => 'string',
        'widget' => 'Select',
        'options' => array(
            'null' => '不限制',
            1 => '正常',
            2 => '回收站',
            3 => '待审核',
        ),
        'validate' => array(),
        'attributes' => array(
            'class' => 'form-control',
        ),
        'required' => false,
    ),
    'sign' => array(
        'label' => '属性',
        'error' => '',
        'userOptions' => array(),
        'description' => '',
        'field' => 'string',
        'operators' => '$in',
        'widget' => 'Selects',
        'options' => array(
            'null' => '不筛选',
            'top' => '置顶',
            'hot' => '热点',
            'essence' => '精华'
        ),
        'validate' => array(),
        'attributes' => array(
            'class' => 'form-control',
            'size' => 1
        ),
        'required' => false,
    ),
    '_options' => array(
        'save' => '\Modules\Entity\Library\Common::submitFilterForm',
        'success' => false,
        'checkToken' => false,
        'validation' => true,
    ),
);
foreach ($di->getShared('entityManager')->contentModel('node') as $key => $value) {
    $output['contentModel']['options'][$key] = $value['name'];
}
unset($key);
unset($value);
return $output;
